package edu.tapestry.iddb.client.pages.buddyIM;

import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Property;

import edu.tapestry.iddb.client.entities.BuddyIM;
import edu.tapestry.iddb.client.pages.AbstrPage;
import edu.tapestry.iddb.client.pages.ErrorPage;
import edu.tapestry.iddb.client.pages.OKPage;
import edu.tapestry.iddb.client.webService.IDDBProxy;

public class RemoveBuddyIM extends AbstrPage{

	@Property
	private BuddyIM buddy;

	@ApplicationState
	private IDDBProxy proxy;

	@InjectPage
	private OKPage ok;

	@InjectPage
	private ErrorPage error;
	
	Object onActionFromRemove(){
		/*
		AbstractResponse resp = proxy.execute(CommandsGenerator.createRemoveBuddy(buddy.getUsername(), buddy.getGroup(), buddy.getPluginIdent()));
		
		if (resp instanceof OkResponse){
			return ok;
		}
		else {
			return error.initialize(resp);
		}
		//*/
		return null;
	}
}
